﻿using System.Collections.Generic;

namespace Citi.ResourceConsolidation.Domain
{
    public partial class ManagedGeography
    {

    }

    public class ManagedGeographyImport : LevelParentImport<ManagedGeography>
    {
        protected override string DescriptionLevelColumn { get { return "Managed Geography L{0} Descr"; } }
        protected override string CodeLevel2Column { get { return "Managed Geography L2"; } }
        protected override string CodeLevel3Column { get { return "Managed Geography L3"; } }
        protected override string CodeLevel4Column { get { return "Managed Geography L4"; } }
        protected override string CodeLevel5Column { get { return "Managed Geography L5"; } }
        protected override string CodeLevel6Column { get { return "Managed Geography L6"; } }
        protected override string CodeLevel7Column { get { return "Managed Geography L7"; } }
        protected override string CodeLevel8Column { get { return "Managed Geography L8"; } }
        protected override string CodeLevel9Column { get { return "Managed Geography L9"; } }
    }

    public class ManagedGeographyComparer : IEqualityComparer<ManagedGeography>
    {
        public bool Equals(ManagedGeography x, ManagedGeography y)
        {
            if (ReferenceEquals(x, y)) return true;
            if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
                return false;

            return x.Description == y.Description && x.Id == y.Id && x.Level == y.Level && x.ParentId == y.ParentId;
        }

        public int GetHashCode(ManagedGeography item)
        {
            if (ReferenceEquals(item, null)) return 0;

            int hashDescription = item.Description == null ? 0 : item.Description.GetHashCode();
            int hashId = item.Description == null ? 0 : item.Id.GetHashCode();

            return hashDescription ^ hashId;
        }
    }
}
